package ${package.Mapper};

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import ${package.Entity}.${table.entityName};

public interface ${table.mapperName}  {

    @Select("SELECT * FROM ${table.name} WHERE `id`=<#noparse>#</#noparse>{id} AND `del_flag`=0")
    ${table.entityName} getById(@Param("id") Long id);

    @Select("SELECT * FROM ${table.name} WHERE `id`=<#noparse>#</#noparse>{id}")
    ${table.entityName} extractById(@Param("id") Long id);

    @Update("UPDATE ${table.name} SET `is_deleted`=1,`update_time`=<#noparse>#</#noparse>{updateTime} WHERE `id`=<#noparse>#</#noparse>{id} ")
    int delete(@Param("id") BigInteger id, @Param("updateTime") Integer updateTime);

    int insert(@Param("${table.entityPath}") ${table.entityName} ${table.entityPath});

    int update(@Param("${table.entityPath}") ${table.entityName} ${table.entityPath});
}

